package dk.flashnotes.fff.exampleMain.parts {
	import flash.text.TextField;	
	
	import dk.flashnotes.fff.page.part.APart;
	
	/**
	 * @author jk
	 */
	public class BasicTextPart extends APart {
		private var _tfHead : TextField;
		
		public function BasicTextPart(sPartID : String = "", xmlPartData : XML = null) {
			super(sPartID, xmlPartData);
		}

		override protected function onPartCreatedAndRegisterd() : void {
			super.onPartCreatedAndRegisterd();
			
			//
			_tfHead = new TextField();
			addChild(_tfHead);
			
			_tfHead.visible=false;
			_tfHead.text = _oPartData.xmlData.head;
			
			//
		}

		override protected function onOpenPart() : void {
			//super.onOpenPart();
			_tfHead.visible=true;
			setPartOpned();
		}

		override protected function onClosePart() : void {
			//super.onClosePart();
			_tfHead.visible=false;
			setPartClosed();
		}

		override public function onKill() : void {
			
			_tfHead=null;
			
			super.onKill();
		}
	}
}
